class Solution {
    public static String largestNumber(int[] nums) {
        int maxVal = 0;
        List<String> list = new ArrayList<>();
        for (int i : nums) {
            maxVal = Math.max(maxVal, i);
            list.add(i + "");
        }
        if (maxVal == 0) {
            return "0";/**/
        }
        list.sort((a, b) -> (b + a).compareTo(a + b));
        StringBuilder sb = new StringBuilder();
        list.forEach(i -> sb.append(i));
        return sb.toString();
    }
}